<%@ page  contentType="text/html; charset=UTF-8"%>
<%@ include file="../public/public.jsp" %>
<% int rowColor = 1; 
	int pageSize = ((Integer)valueStack.findValue("pageForm.pageSize")).intValue();
	int pageNo = ((Integer)valueStack.findValue("pageForm.pageNo")).intValue();
	int rowNo = (pageNo-1)*pageSize+1;
%>
    <table  cellspacing="1" class="dataTableStyle"> 
    	<thead>
    	<s:if test="pagePosition.toLowerCase().equals('top') || pagePosition.toLowerCase().equals('all')">
    		<tr bgcolor="#FFFFFF">
    		
    			<td colspan="20">
    				<ss:page value="pageForm"></ss:page>
    			</td>
    		</tr>
    		</s:if>
    		<tr>
    			<th align="center" width="10%">序号</th>
    			<th align="center" width="45%">期刊号</th>
    			<th align="center" width="12%">操作</th>
    		</tr>
    	</thead>
    	<tbody>
    		<s:set name="yearflag" value=""></s:set>
    		<s:iterator var="magazine" value="data">
    		<% if((rowColor++ %2)==0){ %>
    		<tr onmouseover="changeRowColor(this)" onmouseout="resumeRowColor(this,<%=rowColor%2 %>)" class="data_tr_bgcs1">
    		<%}else{ %>
    		<tr onmouseover="changeRowColor(this)" onmouseout="resumeRowColor(this,<%=rowColor%2 %>)" class="data_tr_bgcs2">
    		<%} %>
    			<s:if test="%{years!=#yearflag}">
    			<s:set name="yearflag" value="years"></s:set>
    				<td colspan="4" class="yearTDStyle">&nbsp;&nbsp;<s:property value="years"/>年</td>
    				</tr>
    				<% 
    				rowNo=1;
    				if((rowColor++ %2)==0){ %>
    					<tr onmouseover="changeRowColor(this)" onmouseout="resumeRowColor(this,<%=rowColor%2 %>)" class="data_tr_bgcs1">
    				<%}else{ %>
    					<tr onmouseover="changeRowColor(this)" onmouseout="resumeRowColor(this,<%=rowColor%2 %>)" class="data_tr_bgcs2">
    				<%} %>
    			</s:if>
    			
    			
    			
    			
    			<td align="center">
    			<%=rowNo++ %>
    			</td>
    			<td align="center">
	    			<a href='javascript:showDetail(<s:property value="id"/>,"<s:property value="magazineName"/>",<s:property value="pageForm.pageNo"/>)' style="cusor:hand">
	    				<s:property value="magazineName"/>
	    			</a>
    			</td>
    			
    			<td align="center">
    				<ss:condition rescode="SouthPeriodical" optcode="UPDATE">
						<a href="javascript:goUpdate(<s:property value="id"/>)">[修改]</a>
					</ss:condition>
					&nbsp;
    				<ss:condition rescode="SouthPeriodical" optcode="DELETE">
						<a href="javascript:del(<s:property value="id"/>)">[删除]</a>
					</ss:condition>
					
					<% boolean haveAccessory = false; %>
					<s:if test="accessoryList.size() > 0">
						&nbsp;
						<s:iterator value="accessoryList" var="accessory">
							<s:if test="#magazine.id == #accessory.sourceRecordId">
								<% haveAccessory = true; %>
								<a href="javascript:download('<s:property value="showName"/>','<s:property value="path"/>','<s:property value="attachmentName"/>','<%=path%>')">[下载]</a>
    						</s:if>
    					</s:iterator>
    				</s:if>
    				
    				<% if(!haveAccessory) {
    					out.print("无附件");
    					
    				} %>
    				
    			
    			</td>
    			
    		 </tr>
    		</s:iterator>
    	</tbody>
		<tfoot>
    	<s:if test="pagePosition.toLowerCase().equals('buttom') || pagePosition.toLowerCase().equals('all')">
    		<tr class="dataList_pageForm_style">
    			<td colspan="20" >
    				<ss:page value="pageForm"></ss:page>
    			</td>
    		</tr>
    		</s:if>
    	</tfoot>
    </table>